import java.util.Objects;

/**
 * @author: gao
 * @create-date: 2025/3/15 16:59
 */

class Person {
    public String id;

    public Person(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

}

public class Test {
    public static void main(String[] args) {
        Person person1 = new Person("1234");
        Person person2 = new Person("1234");
        System.out.println(person1.equals(person2));
        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());
    }
}